<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>法援宝</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/mobiscroll_002.css" >
    <link rel="stylesheet" type="text/css" href="../css/lawyer_user.css" />
    <script type="text/javascript" src="../script/api.js"></script>
    <script type="text/javascript" src="../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../script/mobile.js"></script>
    <script type="text/javascript" src="../script/lawyer.js"></script>
    <!-- <script src="../script/mobiscroll_002.js" type="text/javascript"></script>
    <script src="../script/mobiscroll_004.js" type="text/javascript"></script>
    <script src="../script/mobiscroll.js" type="text/javascript"></script>
    <script src="../script/mobiscroll_003.js" type="text/javascript"></script>
    <script src="../script/mobiscroll_005.js" type="text/javascript"></script> -->
</head>
<body>
<div id="secHeader">
  <header class="header">
      <a href="javascript:void(0);" onclick="comeBack()" class="back_btn"><img src="../image/head-fanhui.png" alt=""></a>
      <h2>排行榜</h2>
      <!--<a href="find_lawyers_edit.html" class="myAnswer_btn edit_btn"><img src="../image/edit_icon.png" alt=""></a>-->
  </header>
</div>

<section class="picture_kinds">
    <div class="news_kinds">
        <ul>
            <li class="active"><a href="javascript:;">好评榜</a></li>
            <li><a href="javascript:;">解答榜</a></li>
            <li><a href="javascript:;">心意榜</a></li>
        </ul>
    </div>
</section>

<section class="about_info" style="padding-top: 0.3rem;">
    <div class="recommend_lawyer">
        <ul id='con'>

        </ul>
    </div>
</section>

</body>
<script>
    var page=1;
    var type=1;
    var p='';
    apiready = function () {
      $api.fixStatusBar( $api.dom('#secHeader') );
      api.setStatusBarStyle({
          style: 'light'
      });
        
        api. addEventListener({name:'scrolltobottom'}, function(ret, err){

            toDoRequest();

        });
        toDoRequest()

    };


    function toDoRequest(){
        p= {type:type,page:page};
        // alert(JSON.stringify(p));
        api.ajax({
            url: webSiteUrl+'/app/public/paihang',
            method: 'post',
            data: {
                values: p
            }
        }, function(ret, err) {

            if(ret.code==200){

                html = "";
                var tj=ret.data;
                if(tj != null){

                    for(var i=0;i<tj.length;i++){
                        if(ck(tj[i].icon)){
                            var u=''
                        }else{
                            var u=webSiteUrl
                        }
html+='<li onclick="lawyer('+tj[i].id+')"><a href="##"><img src="'+u+tj[i].icon+'"><div class="lawyers_info"><h2>'+tj[i].name+'律师 <i>LV.6</i></h2><span class="age">执业'+tj[i].year+'年</span><p class="distance">'+tj[i].addr+'</p><dl>';
                         for(var j=0;j<tj[i].label.length;j++){
                                html+='<dd>'+tj[i].label[j]+'</dd>';
                            }
html+='</dl><dl><dt>服务次数 '+tj[i].servernum+'</dt><dt>综合评价 '+tj[i].score+'%</dt></dl></div></a></li>';

                    }
                }
                if(page==1){
                    $('#con').html(html);
                }else{
                    $('#con').append(html);
                }
                page++;

            }else{
                if(page==1){
                    $('#con').html('<p style="text-align:center">暂无数据</p>');
                }

            }
        });

    }


    $(document).on('click','.news_kinds li',function(){
        $(this).addClass('active').siblings().removeClass('active');
        type=parseInt($(this).index()+1);

        page=1
        toDoRequest();

    });

</script>
</html>
